package com.jyw.business.router.domain.dto;

import cn.hutool.core.util.StrUtil;
import com.jyw.system.domain.dto.HospitalApiRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@ApiModel("创建小程序码请求实体")
@NoArgsConstructor
public class CreateWxCodeDto extends HospitalApiRequest {

    @ApiModelProperty("最大32个可见字符")
    private String scene;

    @ApiModelProperty("指定页面")
    private String page;

    @ApiModelProperty("检查page是否存在")
    private boolean checkPath;

    @ApiModelProperty("小程序版本 正式版为 \"release\"，体验版为 \"trial\"，开发版为 \"develop\"")
    private String envVersion;

    @ApiModelProperty("二维码的宽度")
    private int width;

    @ApiModelProperty("自动配置线条颜色")
    private boolean autoColor;

    @ApiModelProperty("是否需要透明底色")
    private boolean hyaline;

    public CreateWxCodeDto(HospitalApiRequest hospital, String type,String id, String page, String envVersion) {
        setServerKey(hospital.getServerKey());
        setServerSecret(hospital.getServerSecret());
        setScene(StrUtil.format("{}&{}&{}",hospital.getServerKey(),type,id));
        setPage(page);
        setCheckPath(false);
        setEnvVersion(envVersion);
        setWidth(430);
        setAutoColor(true);
        setHyaline(false);
    }
}
